Skip to content

Fix DXC warnings in example and test shaders - #290

Open
CrabExtra wants to merge 1 commit into
masterfrom
dxc_warning_fix
Open

CrabExtra wants to merge 1 commit into
masterfrom
dxc_warning_fix

Conversation

@CrabExtra

Copy link
Copy Markdown
Contributor

No description provided.

}
else // miss
contribution += throughput*(rayDir.y<0.f ? float16_t3(0.1,0.7,0.03):float16_t3(0.05,0.25,1.0));
contribution += throughput*(rayDir.y<0.f ? float16_t3(_static_cast<float16_t>(0.1f),_static_cast<float16_t>(0.7f),_static_cast<float16_t>(0.03f)):float16_t3(_static_cast<float16_t>(0.05f),_static_cast<float16_t>(0.25f),_static_cast<float16_t>(1.0f)));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_static_cast<float16_t3>(float32_t3(X,Y,Z)) didn't work?

Comment on lines +48 to 49
NBL_UNROLL for (uint32_t i = 0; i < scene_type::SphereCount; i++)
{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beware DXC is a piece of crap only int32_t induction variables unroll, better static cast SphereCount

}
}
NBL_UNROLL for (int i = 0; i < scene_type::TriangleCount; i++)
NBL_UNROLL for (uint32_t i = 0; i < scene_type::TriangleCount; i++)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

}
}
NBL_UNROLL for (int i = 0; i < scene_type::RectangleCount; i++)
NBL_UNROLL for (uint32_t i = 0; i < scene_type::RectangleCount; i++)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

{
// prodedural shapes
NBL_UNROLL for (int i = 0; i < scene_type::SphereCount; i++)
NBL_UNROLL for (uint32_t i = 0; i < scene_type::SphereCount; i++)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and so on

return 0.0;
}
NBL_UNROLL for (int i = 0; i < scene_type::TriangleCount; i++)
NBL_UNROLL for (uint32_t i = 0; i < scene_type::TriangleCount; i++)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and so on

return 0.0;
}
NBL_UNROLL for (int i = 0; i < scene_type::RectangleCount; i++)
NBL_UNROLL for (uint32_t i = 0; i < scene_type::RectangleCount; i++)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and so on

uint32_t imgWidth, imgHeight, layers;
cascade.GetDimensions(imgWidth, imgHeight, layers);
retval.cascadeImageDimension = int16_t2(imgWidth, imgHeight);
retval.cascadeImageDimension = int16_t2(_static_cast<int16_t>(imgWidth), _static_cast<int16_t>(imgHeight));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar question as for the float16_t3, coult it be done with a uint32_t2 -> int16_t2 cast ?

SResolverType resolve = SResolverType::create(pc.resolveParameters);

float32_t3 color = resolve(accessor, uint16_t2(coords.x, coords.y));
float32_t3 color = resolve(accessor, uint16_t2(_static_cast<uint16_t>(coords.x), _static_cast<uint16_t>(coords.y)));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Comment on lines +94 to 127
for (uint16_t i = 0; i < 2; i++)
output.uintDim2[i] = qs.get(i);
}
{
sampling::QuantizedSequence<uint32_t, 3> qs = sampling::QuantizedSequence<uint32_t, 3>::create(input.uvec3);
for (uint32_t i = 0; i < 3; i++)
for (uint16_t i = 0; i < 3; i++)
output.uintDim3[i] = qs.get(i);
}
{
sampling::QuantizedSequence<uint32_t, 4> qs = sampling::QuantizedSequence<uint32_t, 4>::create(input.uvec4);
for (uint32_t i = 0; i < 4; i++)
for (uint16_t i = 0; i < 4; i++)
output.uintDim4[i] = qs.get(i);
}

{
sampling::QuantizedSequence<uint32_t2, 2> qs = sampling::QuantizedSequence<uint32_t2, 2>::create(input.uvec2);
for (uint32_t i = 0; i < 2; i++)
for (uint16_t i = 0; i < 2; i++)
output.uintVec2_Dim2[i] = qs.get(i);
}
{
sampling::QuantizedSequence<uint32_t2, 3> qs = sampling::QuantizedSequence<uint32_t2, 3>::create(input.uvec3);
for (uint32_t i = 0; i < 3; i++)
for (uint16_t i = 0; i < 3; i++)
output.uintVec2_Dim3[i] = qs.get(i);
}

{
sampling::QuantizedSequence<uint32_t3, 3> qs = sampling::QuantizedSequence<uint32_t3, 3>::create(input.uvec3);
for (uint32_t i = 0; i < 3; i++)
for (uint16_t i = 0; i < 3; i++)
output.uintVec3_Dim3[i] = qs.get(i);
}
{
sampling::QuantizedSequence<uint32_t4, 4> qs = sampling::QuantizedSequence<uint32_t4, 4>::create(input.uvec4);
for (uint32_t i = 0; i < 4; i++)
for (uint16_t i = 0; i < 4; i++)
output.uintVec4_Dim4[i] = qs.get(i);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unroll just got ruined, use int32_t

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants